using System;
using System.Web.Services.Protocols;

namespace WSSoapCompression
{
	#region Compression Type attribute

	/// <summary>
	/// WSCompression Soap extension. This class does the work indicated by the associated WSCompression attribute
	/// </summary>
	[AttributeUsage(AttributeTargets.Method)]
	public class WSCompression : SoapExtensionAttribute
	{
		#region Privates
		private int _priority = 0;
		private CompressionLevels _comrpessionLevel = CompressionLevels.None;
		#endregion

		#region Properties
		#region ExtensionType
		// Return the type of WSCompress.
		public override Type ExtensionType
		{
			get
			{
				return typeof(WSCompress);
			}
		}
		#endregion

		#region Priority
		public override int Priority
		{
			get {return _priority;}
			set {_priority = value;}
		}
		#endregion

		#region CompressionLevel
		public CompressionLevels CompressionLevel
		{
			get {return _comrpessionLevel;}
			set {_comrpessionLevel = value;}
		}
		#endregion
		#endregion

		#region Constructors
		public WSCompression()
		{
		}

		public WSCompression(CompressionLevels level)
		{
			_comrpessionLevel = level;
		}
		#endregion

	}
	#endregion

	#region WSCompress Header
	/// <summary>
	/// Summary description for WSCompressHeader.
	/// </summary>
	public class WSCompressHeader : SoapHeader
	{
		/// <summary>
		/// Header passed through to indicate whether compression is enabled and if so, how much.
		/// </summary>
		public CompressionLevels CompressionLevel = CompressionLevels.None;
	}
	#endregion

}
